
<template>
  <view class="container">
    <image src="/static/logo.png" class="success-icon"></image>
    <text class="title">预约成功！</text>
    <text class="order-id">订单编号：{{ orderId }}</text>
    <button class="detail-btn" @click="gotoShouYe">返回首页</button>
    <button class="detail-btn" style="margin: 15px;" @click="gotoOrderDetail">查看预约详情</button>
  </view>
</template>

<script setup>
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'

const orderId = ref('')

onLoad((options) => {
  orderId.value = options.orderId
})

const gotoOrderDetail = () => {
  uni.navigateTo({
    url: `/pages/orderDetail/orderDetail?id=${orderId.value}`
  })
}

const gotoShouYe = () =>{
	uni.switchTab({
		url:'/pages/index'
	})
}
</script>

<style>
.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40rpx;
}

.success-icon {
  width: 120rpx;
  height: 120rpx;
  margin: 60rpx 0;
}

.title {
  font-size: 40rpx;
  font-weight: bold;
  margin-bottom: 20rpx;
}

.order-id {
  font-size: 32rpx;
  color: #666;
  margin-bottom: 60rpx;
}

.detail-btn {
  width: 80%;
  background: #007AFF;
  color: white;
  border-radius: 50rpx;
}
</style>